package Map;

import Unit.GameUnit;

public class MapCell {
	private int x;
	private int y;
	private int cellHeight;
	private int cellType;
	private GameUnit cellUnit;
	private int fireTurn;
	
	public MapCell(int x, int y, int cellType) {
		this.x = x;
		this.y = y;
		cellHeight = 0;
		this.cellType = cellType;
		cellUnit = null;
		fireTurn = 0;
	}
	
	public void SetClear() {
		cellHeight = 0;
		cellUnit = null;
		fireTurn = 0;
	}
	
	public void SetUnit(GameUnit unit) {
		cellUnit = unit;
	}
	
	public void SetHeight(boolean isUp, int height) {
		if(isUp)
			cellHeight += height;
		else
			cellHeight = cellHeight > height ? cellHeight - height : 0;
	}
	
	public void SetFire(int turn) {
		fireTurn = turn;
	}
	
	public GameUnit getCellUnit() {
		return cellUnit;
	}
	
	public int getFireTurn() {
		return fireTurn;
	}

	public int getHeight() {
		return cellHeight;
	}
}
